<html>
    <head>
        <link href="https://cdn.bootcss.com/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
        <link href="https://cdn.bootcss.com/bootstrap-fileinput/4.5.1/css/fileinput.min.css" rel="stylesheet">

        <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
        <script src="https://cdn.bootcss.com/popper.js/1.14.4/esm/popper.min.js"></script>
        <script src="https://cdn.bootcss.com/twitter-bootstrap/4.1.3/js/bootstrap.min.js"></script>
        <script src="https://cdn.bootcss.com/bootstrap-fileinput/4.5.1/js/fileinput.min.js"></script>
        <script src="https://cdn.bootcss.com/bootstrap-fileinput/4.5.1/js/locales/zh.min.js"></script>
    </head>

    <div class="container">
        <div class="row">
            <div class="col-md-2"></div>
            <div class="col-md-8">
                <input id="file-input" name="file" type="file" class="file-loading" data-show-preview="false" />
            </div>
            <div class="col-md-2"></div>
        </div>
    </div>

    <script>
$(function() {
    $("#file-input").fileinput({
        showUpload: true,
        showCancel: false,
        enctype: 'multipart/form-data',
        uploadUrl: '/upload'
    }).on("fileuploaded", function(event, data, previewId, index) {
        alert(data.response.text);
    })
});
    </script>

</html>
